home *** CD-ROM | disk | FTP | other *** search
- /***
- *error.c - errno extension
- *
- *Copyright (c) 1991-1994, Gregg Jennings. All wrongs reserved.
- * P O Box 200, Falmouth, MA 02541-0200
- *
- *Purpose:
- * MS(tm)-DOS Disk EDitor error messages.
- *
- *Notice:
- * This progam may be freely used and distributed. Any distrubution
- * with modifications must retain the above copyright statement and
- * modifications noted.
- * No pulp-publication, in whole or in part, permitted without
- * permission (magazines or books).
- *******************************************************************************/
-
- #include <stdio.h>
- #include <string.h>
-
- #include "error.h"
- #include "mylib.h"
-
- struct error_t error;
-
- const char *err_msg[] = {
- "Requires DOS 3+",
- "Not Enough Memory",
- "FAT Phase Error",
- "Bad Cluster No.",
- "Bad Start Cluster No.",
- "More files than FAT",
- "Alloc size of zero",
- "Free NULL pointer",
- "Corrupt heap",
- };
-
- void printerror(int ext)
- {
- if (error.num == -1) /* no error */
- return;
-
- if (ext && error.mod) /* if extened error info and module named */
- {
- print(error.mod);
- /* if function name and not same as module */
- if (error.func && strcmp(error.mod,error.func))
- {
- send(':');
- print(error.func);
- }
- send(' ');
- error.mod = NULL;
- }
- if (error.msg)
- {
- print(error.msg);
- send(' ');
- error.msg = NULL;
- }
- if (error.arg)
- {
- print(error.arg);
- error.arg = NULL;
- }
- error.num = -1;
- }
-